//
//  HXDEvaluationTableViewCell.m
//  qingDaoCircleOfLife
//
//  Created by huxuedong on 15/11/29.
//  Copyright © 2015年 huxuedong. All rights reserved.
//

#import "HXDEvaluationTableViewCell.h"
#import <UIImageView+WebCache.h>

@interface HXDEvaluationTableViewCell ()

@property (weak, nonatomic) IBOutlet UIImageView *iconImage;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *dateLabel;
@property (weak, nonatomic) IBOutlet UIImageView *starImage;
@property (weak, nonatomic) IBOutlet UILabel *infoLabel;

@end

@implementation HXDEvaluationTableViewCell

+ (instancetype)evaluationTableViewCell {
    return [[NSBundle mainBundle] loadNibNamed:@"HXDEvaluationTableViewCell" owner:nil options:nil].lastObject;
}

- (void)awakeFromNib {
    self.iconImage.layer.cornerRadius = 20;
    self.iconImage.clipsToBounds = YES;
    self.infoLabel.numberOfLines = 0;
}

- (void)setComment:(HXDComment *)comment {
    _comment = comment;
    [self.iconImage sd_setImageWithURL:[NSURL URLWithString:comment.photo]];
    self.titleLabel.text = comment.name;
    self.dateLabel.text = comment.time;
    self.infoLabel.text = comment.comment;
    self.starImage.image = [UIImage imageNamed:[NSString stringWithFormat:@"star_%@",comment.score]];
}

@end
